package com.dgut.autoconfig;

import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

import java.util.Objects;


public class RemoteCommandLineRunner implements CommandLineRunner {
    Environment env;
    public RemoteCommandLineRunner(Environment env){
        this.env=env;
    }

    @Override

    public void run(String... args){

        System.out.println("利用Spring Boot自动装配的RemoteCommandLineRunner。");
        System.out.println("生成一个随机字符串：".concat(Objects.requireNonNull(env.getProperty("random."))));
    }
}
